The present invention relates generally to computers and streaming data, and more particularly to an improved method and system for streaming data over computer networks.
Current image compression standards, and the JPEG standard in particular, function well in compressing and decompressing image data. For example, the standard JPEG image compression algorithm yields excellent image quality to compression ratios, especially on photographic or other realistic images. This makes it an excellent scheme for sending images across a network, where the data size is ideally as small as possible to minimize the transmission time. In particular, JPEG is a good compression scheme for sending data via a World Wide Web server where the entire image data is guaranteed to be received.
However, JPEG has certain limitations, including that a JPEG image, as commonly used, cannot be displayed until all of the data has been received. Thus, a long time may pass before the image appears, leading the viewer to wonder about the status of the image. More importantly, if the JPEG header is lost or corrupted when sent across the network, or if, as commonly used, part of the subsequent transmission is lost or corrupted, none of the image can be displayed. This is because of the way that the JPEG compression scheme works; after some initial data, the subsequent image data is based on the data that preceded it. Once such preceding data is lost, the subsequent data is relatively meaningless.
Web browsers and servers work around these limitations in two ways. First, with web browsers and servers, all data is transmitted by a reliable network protocol, so that the image data is xe2x80x9cguaranteedxe2x80x9d to arrive in its entirety, and be uncorrupted. Secondly, some web browsers support an uncommonly used part of the JPEG standard, called progressive JPEG. With this scheme, the image is sent in cycles, with each cycle adding more detail and clarity to the image. This means the image can be displayed (at a lower resolution) when only part of the image has been received, and then subsequently updated and improved as more of the data arrives.
However, in a streaming environment, rapid transmission is desirable, and retransmission is generally too late to be of value. Consequently, low overhead protocols including UDP (User Datagram Protocol) are used for streaming. Moreover, the multicast protocol sends images to multiple recipients, and there is no reasonable way to retransmit selected packets to those who did not receive them, yet remain in synchronization with those who did receive those packets. The protocols used in streaming, such as UDP, are thus unreliable and there is no guarantee that the entire image data will be delivered.
As a result, it often occurs that some of the data is lost in transmission, even if the streaming connection remains functioning. In such a situation, where part of the JPEG image (as commonly used) is received but part of it is lost, none of the image can be displayed. Progressive JPEG would allow part of the image to be displayed, but only of the data loss is towards the end of the transmitted data; if the first part of the compressed data is lost, nothing can be displayed. Moreover, packets tend to be lost in sequence, whereby even if the image could be partially recreated, the consecutive missing blocks would leave substantial gaps in the image.
Accordingly is an objective of the present invention to provide a system and method for configuring JPEG data for streaming transmission that tolerates lost data, enabling a partially received image to be displayed.
In accomplishing that objective, it is a related objective to reduce the likelihood of continuous gaps in a partially-received image.
Another objective is to provide a method and system as characterized above that works with existing JPEG compressors and decompressors.
Still another objective is to provide a method and system of the above kind that enables the configured JPEG data to be stored for subsequent recall and transmission.
Yet another objective is to provide such a system and method that is flexible, efficient, reliable and extensible.
Briefly, the present invention provides a system and method for configuring data, such as pixel image data grouped into JPEG minimum coded units (MCUs), into data that is loss tolerant. The original data are first reorganized into a reversible pattern of reorganized data before compression, e.g., the MCUs are rearranged relative to each other. Then, the data is compressed into restartable segments, for example by providing restart interval information to a JPEG compressor along with the reorganized MCUs. The data is next packetized for transmission, or alternatively saved in a file. If packetized, the location information for at least some of the compressed segments are written into the packets containing at least part of those segments. If saved, the data may be written to a file before or after packetization.
If less than all of the packets are received after transmission thereof, the segments that were received are determined from the location information in the packets that were received. Those segments are decompressed into partial reorganized data, such as JPEG image data, and then the partial reorganized image data is descrambled into partial original image data. The partial original image data may be displayed, and may be enhanced before displaying.
Other objects and advantages will become apparent from the following detailed description when taken in conjunction with the drawings, in which: